package com.cykj.pos.service.impl;

import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.apache.commons.lang3.StringUtils;
import com.cykj.pos.mapper.BizPosStorageMapper;
import com.cykj.pos.domain.BizPosStorage;
import com.cykj.pos.service.IBizPosStorageService;

import java.util.List;
import java.util.Map;

/**
 * 设备入库信息Service业务层处理
 *
 * @author luo
 * @date 2021-09-08
 */
@Service
public class BizPosStorageServiceImpl extends ServiceImpl<BizPosStorageMapper, BizPosStorage> implements IBizPosStorageService {

    @Override
    public List<BizPosStorage> queryList(BizPosStorage bizPosStorage) {
        LambdaQueryWrapper<BizPosStorage> lqw = Wrappers.lambdaQuery();
        if (StringUtils.isNotBlank(bizPosStorage.getManufacturer())){
            lqw.eq(BizPosStorage::getManufacturer ,bizPosStorage.getManufacturer());
        }
        if (StringUtils.isNotBlank(bizPosStorage.getPlatfrom())){
            lqw.eq(BizPosStorage::getPlatfrom ,bizPosStorage.getPlatfrom());
        }
        if (StringUtils.isNotBlank(bizPosStorage.getPosType())){
            lqw.eq(BizPosStorage::getPosType ,bizPosStorage.getPosType());
        }
        if (StringUtils.isNotBlank(bizPosStorage.getSnCode())){
            lqw.eq(BizPosStorage::getSnCode ,bizPosStorage.getSnCode());
        }
        if (StringUtils.isNotBlank(bizPosStorage.getTerminalNum())){
            lqw.eq(BizPosStorage::getTerminalNum ,bizPosStorage.getTerminalNum());
        }
        if (StringUtils.isNotBlank(bizPosStorage.getAddTime())){
            lqw.eq(BizPosStorage::getAddTime ,bizPosStorage.getAddTime());
        }
        if (StringUtils.isNotBlank(bizPosStorage.getPhoneNumber())){
            lqw.eq(BizPosStorage::getPhoneNumber ,bizPosStorage.getPhoneNumber());
        }
        if (StringUtils.isNotBlank(bizPosStorage.getBindingType())){
            lqw.eq(BizPosStorage::getBindingType ,bizPosStorage.getBindingType());
        }
        if (StringUtils.isNotBlank(bizPosStorage.getMerchantNo())){
            lqw.eq(BizPosStorage::getMerchantNo ,bizPosStorage.getMerchantNo());
        }
        if (StringUtils.isNotBlank(bizPosStorage.getBooksAre())){
            lqw.eq(BizPosStorage::getBooksAre ,bizPosStorage.getBooksAre());
        }
        if (StringUtils.isNotBlank(bizPosStorage.getVersionNum())){
            lqw.eq(BizPosStorage::getVersionNum ,bizPosStorage.getVersionNum());
        }
        if (StringUtils.isNotBlank(bizPosStorage.getBindingTime())){
            lqw.eq(BizPosStorage::getBindingTime ,bizPosStorage.getBindingTime());
        }
        return this.list(lqw);
    }
}
